import createAxios from '/@/utils/axios'

export const url = '/admin/routine.queueTasks/'

export const actionUrl = new Map([
    ['index', url + 'index'],
    ['del', url + 'del'],
    ['detail', url + 'detail'],
    ['push', url + 'push'],
])

export function index() {
    return createAxios({
        url: actionUrl.get('index'),
        method: 'get',
    })
}

export function detail(id: number) {
    return createAxios(
        {
            url: actionUrl.get('detail') + '?id=' + id,
            method: 'get'
        }
    )
}



export function push(ids: number) {
    return createAxios(
        {
            url: actionUrl.get('push') + '?ids=' + ids,
            method: 'get'
        },
        {
            showSuccessMessage: true,
        }
    )
}


export function del(ids: string[]) {
    return createAxios(
        {
            url: actionUrl.get('del'),
            method: 'DELETE',
            params: {
                ids: ids,
            },
        },
        {
            showSuccessMessage: true,
        }
    )
}

